package cn.tedu.personal_patient.information.dao.persist.repository.impl;

import cn.tedu.personal_patient.information.dao.persist.mapper.UserMapper;
import cn.tedu.personal_patient.information.dao.persist.repository.IUserRepository;
import cn.tedu.personal_patient.information.pojo.entity.User;
import cn.tedu.personal_patient.information.pojo.vo.UserStandardVO;
import cn.tedu.personal_patient.information.pojo.vo.UserVO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class UserRepositoryImpl implements IUserRepository {


    @Autowired
    private UserMapper userMapper;

    @Override
    public List<UserVO> listById(Long id) {
        return userMapper.listById(id);
    }
    @Override
    public int updateById(User user) {
        return userMapper.updateById(user);
    }

    @Override
    public int avatar(User user) {
        return userMapper.avatar(user);
    }


  /*  @Override

    public int countByPhoneAndNotId(String phone, Long id) {
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("phone", phone);
        queryWrapper.ne("id", id);
        return userMapper.selectCount(queryWrapper);
    }



    @Override
    public int countByEmailAndNotId(String email, Long id) {
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("email", email);
        queryWrapper.ne("id", id);
        return userMapper.selectCount(queryWrapper);
    }
*/
}
